from tqsdk import TqApi
import time
api = TqApi(auth="18064114200,86888196")
q = api.get_quote("KQ.m@SHFE.rb")  

while api.wait_update():
  print(q)
  now = time.localtime()
  if now.tm_hour == 15 or now.tm_hour == 23 or contral == 'q':
      break